package com.direct.ssh.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Work entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_WORK", schema = "OA")
public class Work implements java.io.Serializable,com.direct.ssh.domain.Entity {

	// Fields

	private String id;
	private Employee worker;
	private Employee creator;
	private String name;
	private String remark;
	private Date createTime;
	private Date startTime;
	private Date endTime;
	private Date finishTime;
	private Integer state;
	private Integer valid;

	// Constructors

	/** default constructor */
	public Work() {
	}

	/** full constructor */
	public Work(Employee worker, Employee creator,
			String name, String remark, Date createTime, Date startTime,
			Date endTime, Date finishTime, Integer state,
			Integer valid) {
		this.worker = worker;
		this.creator = creator;
		this.name = name;
		this.remark = remark;
		this.createTime = createTime;
		this.startTime = startTime;
		this.endTime = endTime;
		this.finishTime = finishTime;
		this.state = state;
		this.valid = valid;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "WORKER_ID")
	public Employee getWorker() {
		return this.worker;
	}

	public void setWorker(Employee worker) {
		this.worker = worker;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATOR_ID")
	public Employee getCreator() {
		return this.creator;
	}

	public void setCreator(Employee creator) {
		this.creator = creator;
	}

	@Column(name = "NAME", length = 200)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "REMARK", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "CREATE_TIME")
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "START_TIME")
	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "END_TIME")
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "FINISH_TIME")
	public Date getFinishTime() {
		return this.finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}

	@Column(name = "STATE", precision = 22, scale = 0)
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "VALID", precision = 22, scale = 0)
	public Integer getValid() {
		return this.valid;
	}

	public void setValid(Integer valid) {
		this.valid = valid;
	}

}